package com.whfc.safety.dao;

import com.whfc.safety.dto.SafetyDangerControlDTO;
import com.whfc.safety.dto.SafetyDangerControlNumDTO;
import com.whfc.safety.entity.SafetyDangerControl;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SafetyDangerControlMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SafetyDangerControl record);

    int insertSelective(SafetyDangerControl record);

    SafetyDangerControl selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SafetyDangerControl record);

    int updateByPrimaryKey(SafetyDangerControl record);

    /**
     * 统计管控要点数据
     *
     * @param dangerIds
     * @return
     */
    List<SafetyDangerControlNumDTO> selectNumByDangerIds(@Param("dangerIds") List<Integer> dangerIds);

    /**
     * 批量添加
     *
     * @param deptId
     * @param dangerId
     * @param controlIds
     */
    void insertAll(@Param("deptId") Integer deptId, @Param("dangerId") Integer dangerId, @Param("controlIds") List<Integer> controlIds);

    /**
     * 软删除
     *
     * @param dangerId
     */
    void delByDangerId(Integer dangerId);

    /**
     * 管控要点
     *
     * @param dangerId
     * @return
     */
    List<SafetyDangerControlDTO> selectByDangerId(Integer dangerId);
}